package com.ruoyi.project.cms.type.service.impl;

import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.project.cms.type.domain.CMSType;
import com.ruoyi.project.cms.type.mapper.CMSTypeEditMapper;
import com.ruoyi.project.cms.type.service.ICMSEditService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class CMSEditServiceImpl implements ICMSEditService {

    @Autowired
    private CMSTypeEditMapper cmsEditMApper;
    @Override
    public CMSType selectCMSTypeByPK(Long id) {
        return cmsEditMApper.selectByPK(id);
    }

    @Override
    public int editCMSType(CMSType type) {
        // 设置更新者名称
        type.setUpdateBy(ShiroUtils.getLoginName());
        return cmsEditMApper.updateCMSType(type);
    }
}
